home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / textfile / faqs / aix_fax / part1 next >
Encoding:
Internet Message Format  |  1995-01-01  |  61.7 KB

  1. Xref: bloom-picayune.mit.edu comp.unix.aix:19918 news.answers:4629
  2. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!news.media.mit.edu!micro-heart-of-gold.mit.edu!xn.ll.mit.edu!ames!sun-barr!cs.utexas.edu!mavrick!basto@cactus.org
  3. From: basto@cactus.org (Luis Basto)
  4. Newsgroups: comp.unix.aix,news.answers
  5. Subject: AIX Frequently Asked Questions (Part 1 of 2) [REPOST]
  6. Summary: This posting contains a list of Frequently Asked Questions 
  7.          and their answers about AIX, IBM's version of Unix.
  8. Keywords: AIX RS/6000 questions answers
  9. Message-ID: <1071@mavrick.UUCP>
  10. Date: 16 Dec 92 06:26:56 GMT
  11. Expires: 15 Jan 93 01:23:45 GMT
  12. Sender: luis@mavrick.UUCP
  13. Reply-To: basto@cactus.org (Luis Basto)
  14. Followup-To: comp.unix.aix
  15. Lines: 1629
  16. Approved: news-answers-request@MIT.Edu
  17.  
  18. Archive-name: aix-faq/part1
  19. Last-modified: Dec 12, 1992
  20. Version: 2.0
  21.  
  22.  
  23. Version: $Id: aix.faq,v 2.0 12/12/92 basto $
  24.  
  25. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  26. _____________________________________________________
  27.  
  28. This posting contains frequently asked questions (and answers) about the
  29. IBM RS/6000 series workstations and AIX version 3.  All input is very
  30. welcome, please mail it to basto@cactus.org.
  31.  
  32. The list is split into two articles so it can pass thru most mailers.
  33. I cannot promise any precise periodic posting but I'll try to post an
  34. updated FAQ roughly once a month to comp.unix.aix and to news.answers. 
  35. Please let your input continue, I am most thankful for all of it.
  36.  
  37. If you see a From: line it means that whatever follows is either an
  38. unabridged or slightly edited version of the input I have received, and
  39. that I have not verified its contents.  If there is no From: line, I
  40. probably know what I am talking about, and the entry is edited from
  41. various sources.
  42.  
  43. All entries are numbered with major and minor subject number, e.g. 
  44. 3.05.  If the subject is preceded by an asterisk, that entry has been
  45. changed or added since the last posting.
  46.  
  47. The comp.unix.aix group is really for AIX on the four platforms -- RT,
  48. PS/2, 370 and RS/6000, but it has 90% or more of its traffic covering
  49. AIX 3.x and the RS/6000.  The newsgroups comp.sys.ibm.pc.rt and
  50. comp.sys.ibm.ps2.hardware discuss the PC/RT, mostly hardware and AOS 4.3,
  51. and on PS/2 hardware respectively.  There is no group on AIX for the 370.
  52.  
  53. This article only covers AIX 3.x and the RS/6000, except when
  54. specifically noted.
  55.  
  56. If you post questions to comp.unix.aix, please be sure to indicate:
  57.  
  58. - the machine type (not all questions are to the RS/6000) and brief 
  59.   configuration, e.g. 64 MB RAM, 48 MB swap space (this is actually
  60.   bad), 1.2 GB XYZ hard drive, etc.
  61.  
  62. - the exact AIX version number, i.e. AIX 3.1 is NOT sufficient, whereas
  63.   AIX 3.1.5 or AIX 3.1 with the 3005 update is.
  64. ______________________________________________________________________________
  65. Table of contents:
  66.  
  67. 1.00  The AIX operating system - what is it?
  68. 1.01  I know neither Unix nor AIX - where do I find more information?
  69. 1.02  I am used to Unix systems programming, why should I learn SMIT?
  70. 1.03  What is the Object Database?
  71. 1.04  How do I get rid of the verbose error messages?
  72. 1.05  How do I make an informative prompt in the shell?
  73. 1.06  How do I import an /etc/passwd or /etc/group file from another box?
  74. 1.07  How do I put my own text into InfoExplorer?
  75. 1.08  Who has a termcap/terminfo source for aixterm or the HFT console?
  76. 1.09 *Which release of AIX do I have?
  77. 1.10  Some known problems, telnet, accounting, who
  78. 1.11  Other hints, fsck of /, X-windows and alt-cntl-backspace
  79. 1.12 *How do I shrink /usr?
  80. 1.13 *How do I shrink the default paging space on hd6?
  81. 1.14 *How do I make a filesystem larger than 2 Gig?
  82. 1.15  How do I see/change system parameters like number of processes per user?
  83. 1.16  My /dev/null seems to have disappeared or become a plain file, why?
  84. 1.17  The swapper seems to use extreme amount of paging space, why?
  85. 1.18  How much should I trust the ps memory reports?
  86. 1.19 *How do I mount a floppy disk as a filesystem?
  87. 1.20 *Some info about tape backups
  88. 1.21 *How do I do remote backup?
  89. 1.22  How do I backup a multi-disk volume group?
  90. 1.23  How do I put multiple backups on a single 8mm tape?
  91. 1.24 *How do I remove a committed lpp?
  92. 1.25 *My named dies frequently, why?
  93. 1.26 *How do I trace ethernet packets on an AIX system?
  94.  
  95. 2.00  C/C++
  96. 2.01  I cannot make alloca work
  97. 2.02  How do I compile my BSD programs?
  98. 2.03  Isn't the linker different from what I am used to?
  99. 2.04  How do I link my program with a non-shared /lib/libc.a?
  100. 2.05  How do I make my own shared library?
  101. 2.06  Linking my program fails with strange error, why?
  102. 2.07 *What's with malloc()?
  103. 2.08  Why does xlc complain about 'extern char *strcpy()'
  104. 2.09  Why do I get 'Parameter list cannot contain fewer ....'
  105. 2.10  Why does xlc complain about '(sometype *)somepointer = something'
  106. 2.11  Some more common errors
  107. 2.12  Can the compiler generate assembler code?
  108. 2.13  Curses
  109. 2.14  How do I speed up linking?
  110. 2.15  What is deadbeef?
  111.  
  112. 3.00  Fortran and other compilers
  113. 3.01  I have problems mixing fortran and C code, why?
  114. 3.02  How do I statically bind fortran libraries and dynamically bind
  115.       C libraries?
  116. 3.03  How do I check if a number is NaN?
  117.  
  118. 4.00  Public Domain software
  119. 4.01 *How do I find PD software?
  120. 4.02 *Are there any ftp sites?
  121. 4.03  General hints
  122. 4.04 *GNU Emacs
  123. 4.05 *gcc/gdb
  124. 4.06 *GNU Ghostscript 2.3
  125. 4.07 *TeX
  126. 4.08  Perl
  127. 4.09  X-Windows
  128. 4.10  bash
  129. 4.11  Elm
  130. 4.12 *Oberon 2.2
  131. 4.13 *Kermit
  132. 4.14  Gnu dbm
  133. 4.15  tcsh
  134. 4.16  Kyoto Common Lisp
  135. 4.17  TCL
  136. 4.18  Expect
  137.  
  138. 5.00  Third party products
  139. 5.01  Disk/Tape/SCSI
  140. 5.02  Disks
  141. 5.03  Memory
  142. 5.04  Others
  143. 5.05  IBM List of third party products
  144. 5.06 *C++ compilers
  145.  
  146. 6.00  Miscellaneous other stuff
  147. 6.01  Can I get support by email?
  148. 6.02  Some RS232 hints
  149. 6.03  VT100 key bindings for aixterm
  150. 6.04  What publications are available for AIX and RS/6000?
  151. 6.05  Some acronyms
  152.  
  153. 7.00  How do I get this by mailserver or ftp?
  154. 7.01  Contributors
  155. ______________________________________________________________________________
  156. 1.00: The AIX operating system - what is it?
  157.  
  158. This is best answered by reading the text files in /usr/lpp/bos.  The
  159. README file there contains general information and the bsdadm file
  160. contains useful information if you know BSD and/or SystemV.
  161.  
  162. The last release for the RT PC is 2.2.1. The latest release for 
  163. PS/2s and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1.
  164. For the RS/6000, there are two major levels, 3.1 and 3.2, and various
  165. intermediate levels.
  166.  
  167.  
  168. 1.01: I know neither Unix nor AIX - where do I find more information?
  169.  
  170. Quite a number of questions posted to comp.unix.aix show that AIX is
  171. people's first experience with Unix.  If this is the case with you, you
  172. are advised to look at the other newsgroups in the comp.unix hierarchy,
  173. in particular comp.unix.questions (for basic questions) or
  174. comp.unix.wizards (for difficult questions).  These two groups have a
  175. common FAQ posting as well.
  176.  
  177. If you need information about C programming, try comp.lang.c or comp.std.c,
  178. the latter for Standard ANSI C issues.  comp.lang.c has a FAQ posting.
  179.  
  180.  
  181. 1.02: I am used to Unix systems programming, why should I learn SMIT?
  182.  
  183. Using SMIT is probably very different from your normal way of doing
  184. system administration, but could prove very useful in the long run.  In
  185. some areas, in particular TCP/IP, NFS, etc., you also have the
  186. possibility of doing things the "normal" way, but it is unfortunately
  187. difficult to know exactly when the "normal" way works.  Again, always
  188. using SMIT, is probably your best way to go, even when you have to learn
  189. a new tool.
  190.  
  191. What SMIT actually does is to call a large number of specific tools for
  192. each part of the system administration.  The commands called and the
  193. output they produce are stored in the files smit.script and smit.log in
  194. your home directory.  Looking in smit.script may teach you more about
  195. system administration.
  196.  
  197.  
  198. 1.03: What is the Object Database?
  199.  
  200. The Object Database Manager, ODM, stored in /etc/objrepos, is AIX's way
  201. of storing all the system management information.  Under most
  202. circumstances, only SMIT or the commands SMIT call (see above) should be
  203. used to change the ODM.
  204.  
  205. A harmless way to look at the ODM is to use odmget <Class> where <Class>
  206. is one of the files in /etc/objrepos.
  207.  
  208. The very interested user can use the ODM editor, odme, to navigate the
  209. ODM in detail.  Modifying the ODM should only be attempted if you know
  210. exactly what you are doing.
  211.  
  212.  
  213. 1.04: How do I get rid of the verbose error messages?
  214.  
  215. Many of the messages from the Unix commands are available in different
  216. languages.  This is controlled by the LANG environment variable, the
  217. default being En_US meaning English in the US.  All the default messages
  218. have a message number associated with them, e.g.:
  219.  
  220. $ cat no-such-file
  221. cat: 0652-050 Cannot open no-such-file.
  222.  
  223. If you prefer the terser Unix-looking error message, set your
  224. environment LANG to C, and you will get:
  225.  
  226. $ cat no-such-file
  227. cat: Cannot open no-such-file.
  228.  
  229.  
  230. 1.05: How do I make an informative prompt in the shell?
  231.  
  232. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  233. printed, so you can use:
  234.  
  235. $ myhost=`hostname`
  236. $ PS1='$LOGNAME@$myhost $PWD \$ '
  237.  
  238. to get, e.g. 
  239.  
  240. bengsig@ieibm1 /u/bengsig $
  241.  
  242. In the C-shell, use:
  243.  
  244. % set myhost=`hostname`
  245. % alias cd 'chdir \!*' > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  246. % cd
  247.  
  248. to get, e.g.
  249.  
  250. bengsig@dkunix9 /u/bengsig/aixfaq %
  251.  
  252. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  253.  
  254.  
  255. 1.06: How do I import an /etc/passwd or /etc/group file from another box?
  256.  
  257. Make sure that you run usrck and pwdck (/etc/passwd) and grpck
  258. (/etc/group) to let AIX work its password/group magic.
  259.  
  260.  
  261. 1.07: How do I put my own text into InfoExplorer?
  262.  
  263. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  264. InfoCrafter that allows you to do that.
  265.  
  266.  
  267. 1.08: Who has a termcap/terminfo source for the HFT console?
  268.  
  269. The console used on the RISC System/6000, the PS/2 and the RT can be
  270. used as a terminal on another system with the termcap below.  You can find
  271. this and other termcaps in /lib/libtermcap/termcap.src, including IBM
  272. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  273. This termcap can also be used from an aixterm window.
  274.  
  275. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  276.     :co#80:li#25:am:ht:\
  277.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  278.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  279.     :bs:sf=\E[S:ec=\E[%dX:\
  280.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  281.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  282.     :im=\E[4h:ei=\E[4l:mi:\
  283.     :dm=\E[4h:ed=\E[4l:\
  284.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  285.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  286.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  287.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  288.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  289.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  290.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  291.  
  292.  
  293. 1.09: Which release of AIX or other products do I have?
  294.  
  295. The command 'lslpp -h bos.obj' will show all lines referring to the BOS, 
  296. Basic Operating System.  E.g.:
  297.  
  298. Option Name          State      Event      Date      Release         User Name
  299.  
  300. -------------------- ---------- ---------- --------- --------------- ----------
  301. bos.obj              INACTIVE   COMMIT     02/03/90  03.01.0000.0000 root
  302.                      INACTIVE   APPLY      06/25/90  03.01.0000.0001 root
  303.                      INACTIVE   COMMIT     06/25/90  03.01.0000.0001 root
  304.                      INACTIVE   APPLY      11/16/90  03.01.0002.0015 root
  305.                      INACTIVE   COMMIT     11/16/90  03.01.0002.0015 root
  306.              ACTIVE     COMMIT     05/07/91  03.01.0005.0012 root
  307.  
  308. gives the history for the BOS lpp.  The last line, column four, tells
  309. that this is release 3.1.5.  (Note that '3' in 3005 has nothing to do
  310. with '3' in 3.1.5 - we should stop calling the versions 3005, etc.  and
  311. call it by its real version number 3.1.5).
  312.  
  313. To see a listing of everything installed use lslpp -l '*', then use
  314. lslpp with the -h option as above to get a history of a particular lpp. 
  315.  
  316. Here is a description on IBM's release numbering scheme:
  317.  
  318. From: jswillia@nycvmic2.vnet.ibm.com
  319.  
  320. The output of lslpp -h bos.obj shows a release number similar to
  321. 03.01.0002.0003.
  322.  
  323. Contrary to your description and some other news items, this should be
  324. referred to as 3.1.2 not 3002. The 3002 numbering is used to indicate
  325. a PTF update tape. There are two types of PTF tapes 300x and 200x.
  326. The 300x tapes are full PTF's to update all previous levels to 3.1.x level
  327. The 200x tapes are incremental tapes and only apply to level 3.1.(x-1),
  328. ie 2004 updates 3.1.3 to 3.1.4 and will not work with 3.1.2 at all,
  329. whereas 3004 would update 3.1.0, 3.1.1, 3.1.2, and 3.1.3 upto level 3.1.4.
  330. The release number is defined as follows, 03.01 is the major release number
  331. shortened to 3.1 and the 0002 in the example is the minor release number.
  332. Major releases are provided with full installable tapes, whereas minor
  333. releases are obtained by applying a PTF update tape to a previous level
  334. as indicated above. The fourth number is used by development and has no
  335. validity(?) outside of development ( note it may be of interest during
  336. defect resolution ).
  337.  
  338. For AIX 3.2, it's a completely different scheme.  You may come across
  339. discussions on releases 3.2.0, 3.2.1, 3.2.2, or 3.2.3.  There is no
  340. absolute way to tell which of these you are running since the newer
  341. releases are simply 3.2.0 with some sets of PTFs added.  And since one
  342. can apply selective fixes it is possible that there could be many
  343. slightly different variations of 3.2 in use.  IBM is currently working
  344. on resolving this situation.
  345.  
  346.  
  347. 1.10: Some known problems, telnet, accounting, who
  348.  
  349. There are known problems in telnetd in 3.1.2 and 3.1.3 (the RS/6000 may
  350. lock when telnet'ing to it, use the 3001 telnetd or update to 3.1.5),
  351. accounting has a number of problems, and 'who' often displays entries
  352. that do not correspond to active sessions.
  353.  
  354. Following refers to 3.1.2 and 3.1.3.
  355.  
  356. The problem with telnetd seems to be solved in 3.1.5, I do not know about
  357. accounting, but the problem with who is known not to be solved.  The
  358. program below by jfh@rpp386.cactus.org (John F. Haugh) can be used to fix
  359. up your /etc/utmp file:
  360.  
  361. #include <sys/types.h>
  362. #include <utmp.h>
  363. #include <fcntl.h>
  364.  
  365. main ()
  366. {
  367.     int    fd;
  368.     struct    utmp    utmp;
  369.  
  370.     while (1) {
  371.         if ((fd = open ("/etc/utmp", O_RDWR)) < 0)
  372.             exit (1);
  373.  
  374.         while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
  375.             if (utmp.ut_type == USER_PROCESS &&
  376.                     kill (utmp.ut_pid, 0) != 0) {
  377.                 lseek (fd, - (long) sizeof utmp, 1);
  378.                 utmp.ut_type = DEAD_PROCESS;
  379.                 write (fd, &utmp, sizeof utmp);
  380.             }
  381.         }
  382.         close (fd);
  383.         sleep (60);
  384.     }
  385. }
  386.  
  387. Another utmp program was posted to comp.sources.unix, volume 25, issue
  388. 96 by David W. Sanderson (dws@cs.wisc.edu) that also works on AIX 3.1.
  389.  
  390.  
  391. 1.11: Other hints, fsck of /, X-windows and cntl-alt-backspace
  392.  
  393. - Normally cntl-alt-backspace will kill the X session.  If you add the
  394.   -T option when initializing X, this will not happen.
  395.  
  396. - You should never run fsck on mounted filesystems; you need to be in
  397.   maintenance mode to run fsck on the root filesystem:
  398.  
  399.   1. boot from diskette
  400.   2. select maintenance mode
  401.   3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if not
  402.      hdisk0)
  403.   4. fsck /dev/hd4
  404.  
  405.  
  406. 1.12: How do I shrink /usr?
  407. From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting
  408.  
  409. FOR AIX 3.1
  410. -----------
  411.  
  412.  1) Make a backup of /usr
  413.  
  414.         find /usr -print | backup -ivf /dev/rmt0
  415.  
  416.     Use the appropriate tape device if it is not rmt0.
  417.  
  418.  2) shutdown to maintenance mode
  419.  
  420.         shutdown -Fm
  421.  
  422.  3) export LANG=C
  423.  
  424.  4) remove the filesystem and the logical volume
  425.     ignore an error about the "dspmsg" command not found
  426.  
  427.         umount /usr
  428.         rmfs /usr
  429.  
  430.  5) make a new logical volume hd2 and place it on rootvg with desired size
  431.  
  432.         mklv -yhd2 -a'e' rootvg NNN 
  433.  
  434.    where NNN is the number of 4 meg partitions
  435.  
  436.  6) create a filesystem on /dev/hd2
  437.  
  438.         crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'
  439.  
  440.  7) mount the new /usr filesystem and check it
  441.  
  442.         /etc/mount /usr
  443.         df -v
  444.  
  445.  8) restore from the tape; system won't reboot otherwise
  446.  
  447.         restore -xvf/dev/rmt0
  448.  
  449.  9) Sync and reboot the system; you now have a smaller /usr filesystem
  450.  
  451. FOR AIX 3.2
  452. -----------
  453.  
  454.  1) Remove any unneeded files from /usr.
  455.  
  456.  2) Make sure all filesystems in the root volume group are mounted. If
  457.     not, they will not be included in the re-installed system.
  458.  
  459.  3) Type "mkszfile". This will create "/.fs.size" that contains a list
  460.     of the active filesystems in the root volume group that will be
  461.     included in the installation procedure.
  462.  
  463.  4) Edit .fs.size. Change the size of /usr to what you want.
  464.  
  465.     Example: This .fs.size file shows /usr to be 40MB.
  466.  
  467.                    rootvg 4 hd2 /usr 10 40 jfs
  468.  
  469.     The number 10 is the number of physical partitions for the filesystem
  470.     and the 40 is 40 MB. Most systems have a physical partition
  471.     size of 4 MB. Therefore, the second number (40) will always be
  472.     4 times the previous number (10). Note, however, that a model 320
  473.     with a 120 MB drive will have a physical partition size of only 2 MB,
  474.     and the total MB is therefore twice the number of physical partitions.
  475.     The first number (4) in the .fs.size file represents the PP size.
  476.  
  477.     If you want to reduce the size of /usr from 40 MB to 32 MB, 
  478.     edit the /usr entry to:
  479.  
  480.         rootvg 4 hd2 /usr 8 32 jfs
  481.  
  482.     IMPORTANT: Make sure that you DO NOT enter a value which is less
  483.     than the size of the filesystem required to contain the current
  484.     data. Doing so will cause the re-installation procedure to fail.
  485.  
  486.  5) chdev -l rmt0 -a block=512 -T
  487.  
  488.  6) Unmount all filesystems that are NOT in the root volume group.
  489.  
  490.  7) Varyoff all user-defined volume groups, if any
  491.  
  492.         varyoffvg VGname
  493.  
  494.  8) Export the user-defined volume groups, if any
  495.  
  496.         exportvg VGname
  497.  
  498.  9) With a tape in the tape drive, type
  499.  
  500.         mksysb /dev/rmt0
  501.  
  502.      This will do a complete system backup, which will include
  503.      information (in the .fs.size file) for the installation procedure
  504.      on how large the filesystems are to be created.
  505.  
  506.  10) Follow the instructions in the Installation Kit under "How to
  507.      Install and perform maintenance from Diskettes" using the
  508.      diskettes and tape that you created in the previous steps.
  509.      DO NOT select the option "Reinstall AIX with Current System
  510.      Settings" during the install procedure. The new system must be
  511.      installed using the option "Install AIX with Current System
  512.      Settings" for the logical volume size changes to take affect.
  513.  
  514.  11) When the operating system installation is complete, you may then
  515.      import the information into your newly installed operating system
  516.      for any user-defined volume groups.
  517.  
  518.          importvg -y VGname PVname
  519.  
  520.      where "VGname" is the name of the volume group, and "PVname" is
  521.      the name of any one of the physical volumes in the volume group.
  522.  
  523.  12) Varyon your user-defined volume groups
  524.  
  525.          varyonvg VGname
  526.  
  527.  The reduction of the filesystems is now complete.
  528.  
  529.  
  530. 1.13: How do I shrink the default paging space on hd6?
  531.  
  532. 1) create a paging space to use temporarily
  533.    mkps -s 20 -a rootvg
  534.  
  535. 2) change default paging space hd6 so it is not used at next reboot
  536.    chps -a n hd6
  537.  
  538. 3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6;
  539.    for AIX 3.2, edit /sbin/rc.boot and change swapon /dev/hd6
  540.    swapon /dev/paging00
  541.  
  542. 4) Update information in boot logical volume
  543.    bosboot -a             (3.1)
  544.    bosboot -a -d hdisk0   (3.2)
  545.  
  546. 5) shutdown and reboot
  547.  
  548. 6) remove current hd6 and create a new one of smaller size
  549.    rmps hd6
  550.    mklv -y hd6 -t paging rootvg <size of PS in 4 Meg blocks>
  551.  
  552. 7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
  553.    swapon /dev/hd6
  554.  
  555. 8) Update information in boot logical volume
  556.    bosboot -a             (3.1)
  557.    bosboot -a -d hdisk0   (3.2)
  558.  
  559. 9) change current paging device (paging00) so it is inactive at next boot
  560.    chps -a n /dev/paging00
  561.  
  562. 10) shutdown, reboot, remove paging00 using the command:
  563.     rmps paging00
  564.  
  565.  
  566. 1.14 *How do I make a filesystem larger than 2 Gig?
  567.  
  568. The largest filesystem under AIX is 2 Gigabytes because the largest
  569. signed integer is 2**32 - 1.
  570.  
  571.  
  572. 1.15: How do I see/change system parameters like number of processes per user?
  573.  
  574. You can use SMIT as described below or simply use the lsattr/chdev pair. 
  575. The former will list the current setting as in:
  576.  
  577.   # lsattr -E -l sys0 -a maxuproc
  578.   maxuproc 40 Maximum # of processes allowed per user True
  579.  
  580. and you can then increase the maxuproc parameter:
  581.  
  582.   # chdev -l sys0 -a maxuproc=200
  583.   sys0 changed
  584.  
  585. If you just type 'lsattr -E -l sys0' you will get a list of all parameters,
  586. some of which can be changed - others not.
  587.  
  588. If you want to use smit, this procedure can be followed:
  589.  
  590. smit
  591.   System Environments and Processes
  592.     Change / Show Operating System Parameters
  593.       - on this screen you can change by overtyping the following fields:
  594.         - Maximum number of PROCESSES allowed per user
  595.         - Maximum number of pages in block I/O BUFFER CACHE
  596.         - Maximum Kbytes of real memory allowed for MBUFS
  597.       - toggle fields exist for:
  598.         - Automatically REBOOT system after a crash  (false/true)
  599.         - Continuously maintain DISK I/O history (true/false)
  600.  
  601.  
  602. 1.16: My /dev/null seems to have disappeared or become a plain file, why?
  603.  
  604. The script /usr/etc/lsnfsexp has a bug in 3.1.3. Change line 100 from
  605.   rm -rf ${TMP_FILE} >/dev/null 2>&1 /dev/null
  606. to
  607.   rm -rf ${TMP_FILE} >/dev/null 2>&1
  608.  
  609. and recreate /dev/null by:
  610.  
  611.   # mknod /dev/null c 2 2
  612.   # chmod 666 /dev/null
  613.  
  614. This is fixed in release 3.1.5.
  615.  
  616.  
  617. 1.17: The swapper seems to use extreme amount of paging space, why?
  618.  
  619. When you run ps, you may see a line like:
  620.  
  621. USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
  622. root     0 0.0%  14% 386528  8688      -    S 17:06 swapper
  623.  
  624. This is normal behavior, the swapper looks to ps like it has the entire
  625. paging space plus real memory allocated.
  626.  
  627.  
  628. 1.18: How much should I trust the ps memory reports?
  629. From: chukran@austin.VNET.IBM.COM
  630.  
  631. Using "ps vg" gives a per process tally of memory usage for each running
  632. process.  Several fields give memory usage in different units, but these
  633. numbers do not tell the whole story on where all the memory goes.
  634.  
  635. First of all, the man page for ps does not give an accurate description
  636. of the memory related fields.  Here is a better description:
  637.  
  638. RSS - This tells how much RAM resident memory is currently being used
  639. for the text and data segments for a particular process in units of
  640. kilobytes.  (this value will always be a multiple of 4 since memory is
  641. allocated in 4 KB pages).
  642.  
  643. %MEM - This is the fraction of RSS divided by the total size of RAM for
  644. a particular process.  Since RSS is some subset of the total resident
  645. memory usage for a process, the %MEM value will also be lower than actual.
  646.  
  647. TRS - This tells how much RAM resident memory is currently being used
  648. for the text segment for a particular process in units of kilobytes. 
  649. This will always be less than or equal to RSS.
  650.  
  651. SIZE - This tells how much paging space is allocated for this process
  652. for the text and data segments in units of kilobytes.  If the executable
  653. file is on a local filesystem, the page space usage for text is zero. 
  654. If the executable is on an NFS filesystem, the page space usage will be
  655. nonzero.  This number may be greater than RSS, or it may not, depending
  656. on how much of the process is paged in.  The reason RSS can be larger is
  657. that RSS counts text whereas SIZE does not.
  658.  
  659. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  660. and does not correlate to any of the other fields.
  661.  
  662. These fields only report on a process text and data segments.  Segment
  663. size which cannot be interrogated at this time are:
  664.  
  665.        Text portion of shared libraries (segment 13)
  666.  
  667.        Files that are in use. Open files are cached in memory as
  668.        individual segments.  The traditional kernel cache buffer
  669.        scheme is not used in AIX 3.
  670.  
  671.        Shared data segments created with shmat.
  672.  
  673.        Kernel segments such as kernel segment 0, kernel extension
  674.        segments, and virtual memory management segments.
  675.  
  676. Speaking of kernel segments, the %MEM and RSS report for process zero
  677. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  678. kernel segment zero is counted twice.  For AIX 3.2, this has been
  679. changed, but the whole story is still not known.  The RSS value for
  680. process 0 will report a very small number of the swapper private data
  681. segment.  It does not report the size of the kernel segment 0, where the
  682. swapper code lives.
  683.  
  684. In summary, ps is not a very good tool to measure system memory usage. 
  685. It can give you some idea where some of the memory goes, but it leaves
  686. too many questions unanswered about the total usage.
  687.  
  688.  
  689. 1.19 *How do I mount a floppy disk as a filesystem?
  690.  
  691. From: op@holmes.acc.Virginia.EDU (Olaf Pors)
  692.  
  693. You can build a filesystem on a floppy and mount it, however the
  694. filesystem will be read only.  The reason that the filesystem will be
  695. read only is because AIX Version 3.1.5 cannot create a journal log on a
  696. diskette.  The intended use is for temporary access to the read only
  697. data.  The diskette file system must be unmounted after use and during
  698. system backup procedures or errors could occur.
  699.  
  700. To make the read only filesystem on a floppy:
  701.  
  702. 1. Make a subdirectory on an existing filesystem on the hardfile, and
  703.    place all of the files that the diskette will contain into this
  704.    subdirectory.
  705.  
  706. 2. Enter the following command to create a prototype file containing
  707.    information about the new filesystem, in the example /dir_struct
  708.    is the pathname of the subdirectory created in step 1, and
  709.    proto_filename is the name of the prototype file to be created.
  710.  
  711.          proto /dir_struct > proto_filename
  712.  
  713. 3. Place your floppy disk into the drive and format it.
  714.  
  715. 4. Edit the prototype file and replace the first line with the following:
  716.  
  717.          <noboot> 0 0
  718.  
  719. 5. Enter the following command to make the filesystem on your floppy:
  720.  
  721.           mkfs -p proto_filename -V jfs /dev/fd0
  722.  
  723. 6. Create the directory upon which you will mount the floppy based
  724.    filesystem, or you can use the /mnt directory.  Enter the following
  725.    command to mount the filesystem:
  726.  
  727.           mount -r -V jfs /dev/fd0 /your_mount_point
  728.  
  729. 7. To unmount the filesystem, use the command:
  730.  
  731.           umount /dev/fd0
  732.  
  733. Since the filesystem is read-only it may be of limited use but if you
  734. are going to use it for utility programs and other data that does not
  735. change much, it still may be useful.  If you need to change the data,
  736. you can copy the directory from the floppy into another directory, make
  737. your modifications, and remake the filesystem using this procedure.
  738.  
  739.  
  740. 1.20  Some info about tape backups
  741. From: Craig Anderson
  742.  
  743. The following supplements the information on rmt devices in
  744. InfoExplorer.  It is based on my own personal experience with IBM tape
  745. drives running on AIX 3.1.  No warranty is expressed or implied.
  746.  
  747. CONFIGURING THROUGH SMIT:
  748.     BLOCK size (0=variable length)        (ALL)
  749.     Sets the tape block size.  When reading, the block size must be
  750.     set to the block size set when the tape was written.  When
  751.     using some commands, tapes written with ANY block size can be
  752.     read if the block size is set to 0 (variable length) (see
  753.     "BLOCK SIZES" below).
  754.  
  755.     Use DEVICE BUFFERS during writes        (ALL)
  756.     Set to yes, the device will buffer data internally on writes.
  757.     This greatly improves performance, but under certain cases may
  758.     be undesirable since the data is not written to tape before
  759.     returning a good indication.
  760.  
  761.     Use EXTENDED file marks            (8mm only)
  762.     Extended file marks take up much more space than short (or
  763.     non-extended) file marks.  But extended file marks can be
  764.     overwritten, allowing data not at the beginning of tape to be
  765.     overwritten (see "FILE MARKS" below).
  766.  
  767.     RETENSION on tape change or reset        (1/4" only)
  768.     If set to "no" then the tape will not be retentioned
  769.     automatically when the tape is inserted.  Note that this will
  770.     take effect only after the device is used.
  771.  
  772.  
  773. FILE MARKS:
  774.      Tape devices support multiple tape files.  Tape files are the
  775.      result of a backup/cpio/tar/dd type command, where the device is
  776.      opened, written to, and closed.  Because tapes allow large
  777.      quantities of data to be written on a single tape, several backups
  778.      (that is, tape files), may be combined on one physical tape.
  779.      Between each tape file is a "tape file mark" or simply "file
  780.      mark".  These file marks are used by the device driver to indicate
  781.      where one tape file ends and another begins.
  782.  
  783.                               B       E
  784.                    <-------   O       O   ------->
  785.                               T       T
  786.               __ ____________________________ _______________
  787.      physical | \            |       |      \             |physical
  788.      beginning|  \           | tape  |       \            | end
  789.        of     |   \          | file  |        \           |  of
  790.       tape    |    \         | mark  |         \          | tape
  791.               |_____\________|_______|__________\_________|
  792.  
  793.      Note that there is a distinction between the beginning of tape
  794.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  795.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  796.      1" command will move only to the EOT side of the same file mark.
  797.  
  798.      With the 1/4" tape drive, writing can only take place
  799.      sequentially, or after blank tape has been detected.  You cannot
  800.      write over data on the tape (except at BOT).  If you wish to add
  801.      data to a tape which has been written and then rewound you should
  802.      space forward file mark until an error occurs.  Only then can
  803.      you start writing again.
  804.  
  805.      With an 8mm tape drive, writing can only take place before blank
  806.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  807.      have been made on one tape and you wish to overwrite one of the
  808.      backups, position the tape to the place you wish to start writing
  809.      and issue the following commands:
  810.     tctl bsf 1
  811.     tctl eof 1
  812.      The first command skips back to the BOT side of the same file
  813.      mark.  The second command rewrites the file mark (writing is
  814.      allowed before extended file marks).  The erase head will erase
  815.      data ahead of the write head, so that after writing the file mark
  816.      the head will be positioned before blank tape.  Only after this
  817.      may you start writing over data in the middle of the tape.  (All
  818.      data beyond where you are currently writing will be lost).  Note
  819.      that you cannot write over short file marks.  In order for this to
  820.      work, the tape must have been written with extended file marks
  821.      (use smit to change this).
  822.  
  823.      With the 9-track drive writing can take place anywhere on the
  824.      tape although overwriting single blocks of data is not supported.
  825.  
  826.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  827.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  828.      and take up to 1.5 seconds to write.
  829.  
  830. BLOCK SIZES:
  831.      When data is written to tape it is written in blocks.  The blocks
  832.      on a tape are separated by inter-record gaps.  It is important to
  833.      understand the structure of the written tape in order to
  834.      understand the problems which can occur with changing block
  835.      sizes.
  836.  
  837.      In fixed block size mode all blocks on the tape are the same
  838.      size.  They are the size of the block size set in the device
  839.      configuration.  All read()s and write()s to the tape drive must be
  840.      a multiple of the fixed block size.
  841.  
  842.      In fixed block mode a read() will return as many blocks as needed
  843.      to satisfy the read() request.  If a file mark is encountered
  844.      while reading the tape only the data up until the file mark will
  845.      be returned.
  846.  
  847.      It is not possible for the tape drive to read a tape whose block
  848.      size is not the same as the block size in the device
  849.      configuration.  (Unless the device configuration is in variable
  850.      size blocks.)
  851.  
  852.      In variable block size (0) mode, the blocks written on the tape
  853.      are the size of the read() and write() requests to the device
  854.      driver.  In this case, the actual block sizes on the tape can be
  855.      changed using the options to the backup commands (tar -C, cpio -C,
  856.      backup -C).
  857.  
  858.      In variable mode, read() requests greater than size of the block
  859.      on the tape will return only the data from the next block on the
  860.      tape.  It is this feature that allows tapes written in any block
  861.      size (fixed or variable) to read with the dd command (the output
  862.      from the dd command may be piped to restore, tar, or cpio for
  863.      example.)  Note that backup, tar, and cpio cannot read all tapes
  864.      by using a large block size because they assume there is an error
  865.      if they get a short read().
  866.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  867.  
  868.      The tape head is always positioned at an inter-record gap, file
  869.      mark, or blank tape after reading or writing.
  870.  
  871.      With the 8mm tape drive, using a fixed block size which is not a
  872.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  873.      internally in 1K blocks.  It simulates the effect of variable
  874.      block sizes, but, for example, using a fixed block size of 512
  875.      bytes (or using variable block size and write()ing 512 bytes at a
  876.      time) wastes one half of the tape capacity and gives only one half
  877.      the maximum transfer rate.
  878.  
  879.  
  880. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  881.      Many tape drives support both variable and fixed block sizes.
  882.  
  883.      Variable block mode writes block sizes the size of the write
  884.      command issued (tar and backup specify this with the -b option). 
  885.      In fixed mode, block sizes are fixed and all writes must be a
  886.      multiple of the fixed block size.
  887.  
  888.      Unix often internally chops larger reads and writes up into
  889.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  890.      doing the actual reads and writes.  This means reads and writes of
  891.      64K bytes are often broken up into a 65535 byte record and a 1
  892.      byte record (In fixed mode the write will fail).  Block sizes >=
  893.      64K (-C128 and greater) should be avoided for this reason.  AIX
  894.      does not break up read and write requests, but be aware of the
  895.      situation on other machines.
  896.  
  897.      If the tape is written in an unknown block size then set the
  898.      device configuration in smit to use variable size blocks, use the
  899.      "dd" command with a large input block size, and pipe it to the
  900.      restore command.  For example:
  901.       chdev -l rmt0 -a block_size=0
  902.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  903.  
  904.  
  905. 1.21: *How do I do remote backup?
  906. From: oquinn@elder.austin.ibm.com
  907.  
  908. You can back up files on a remote tape drive with:
  909.  
  910.   tar -cBf - . | rsh REMOTEHOST "tar -xBf /dev/TAPEDEVICE"
  911.  
  912.  
  913. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  914.  
  915. mksysb will not back up to remote tape devices. Frank provided the
  916. following script to do remote backups.
  917.  
  918. #!/bin/ksh
  919. # @(#) Create a backup tape of the private user data.
  920. #=================================================================#
  921. #   Script :  usave.sh                                            #
  922. #   Author :  F. Kraemer                                          #
  923. #   Date   :  92/02/19                                            #
  924. #   Update :  92/10/29                                            #
  925. #   Info   :  the ultimative backup script                        #
  926. #   Example:  usave.sh /dev/rmt0      -  save to local tape       #
  927. #             usave.sh /save/save.me  -  save to local file       #
  928. #             usave.sh /tmp/pipe      -  save to remote tape      #
  929. #-----------------------------------------------------------------#
  930. PS4="(+) "
  931. #set -x
  932. PROG=$(basename $0)
  933. HOST=$(hostname)
  934. TODAY=$(date +%H:%M:%S)
  935. #-----------------------------------------------------------------#
  936. # cleanup                                                         #
  937. #-----------------------------------------------------------------#
  938. cleanup ()
  939. {
  940. ec=$1
  941. error=$2
  942. case "$ec"
  943. in
  944.    "$USAGE_EC")    # usage error
  945.      error="Usage:\t$PROG DeviceName\n" 1>&2
  946.     ;;
  947.    "$NOTAP_EC")    # Tape error
  948.      error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
  949.     ;;
  950.    "$LISTE_EC")    # list error
  951.      error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
  952.     ;;
  953.    "$NOTAR_EC")    # tar command error
  954.      error="error:\t$PROG: tar command failed.\n" 1>&2
  955.     ;;
  956.    "$PIPEP_EC")    # pipe error
  957.      error="error:\t$PROG: mknod command failed.\n" 1>&2
  958.     ;;
  959.    "$NORSH_EC")    # rsh error
  960.      error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
  961.     ;;
  962.    "$RHOST_EC")    # remote host error
  963.      error="error:\t$PROG: Remote Host unknown.\n" 1>&2
  964.     ;;
  965.    *)
  966.    ;;
  967. esac
  968. case "$DEVICE"
  969. in
  970.     #
  971.     # Fix the block size if $DEVICE is a tape device
  972.     #
  973.     /dev/rmt[0-9]*)
  974.         echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
  975.         tctl -f $DEVICE rewind 2>/dev/null
  976.         ;;
  977.     *) ;;
  978. esac
  979. rm -f ${LIST} ${PIPE} 2>/dev/null
  980. [ -n "$error" ] && echo "\n${error}\n"
  981. trap '' 0 1 2 15
  982. exit "$ec"
  983. }
  984. #-----------------------------------------------------------------#
  985. # Variables.                                                      #
  986. #-----------------------------------------------------------------#
  987. USAGE_EC=1                         # exit code for usage error
  988. NOMNT_EC=2                         # exit code wrong device name
  989. NOTAP_EC=3                         # exit code no tape available
  990. LISTE_EC=4                         # exit code backup list error
  991. NOTAR_EC=5                         # exit code for wrong tar
  992. TRAPP_EC=6                         # exit code for trap
  993. PIPEP_EC=7                         # exit code for pipe
  994. RHOST_EC=8                         # exit code for bad ping
  995. NORSH_EC=9                         # exit code for bad rsh
  996. DEVICE="$1"                        # device to tar into
  997. LIST="/tmp/.tar.$LOGNAME.$$"       #
  998. REMOTEH=""                         # Remote host for backup
  999. REMOTET=""                         # Remote tape for backup
  1000. tapedev=                           #
  1001. PIPE="/tmp/pipe"                   # Pipe for remote backup
  1002. #-----------------------------------------------------------------#
  1003. # main()                                                          #
  1004. #-----------------------------------------------------------------#
  1005. tput clear
  1006. echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
  1007. rm -f $LIST 2>/dev/null
  1008. #-----------------------------------------------------------------#
  1009. # Trap on exit/interrupt/break to clean up                        #
  1010. #-----------------------------------------------------------------#
  1011. trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
  1012. #-----------------------------------------------------------------#
  1013. # Check command options                                           #
  1014. #-----------------------------------------------------------------#
  1015. [ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
  1016. #-----------------------------------------------------------------#
  1017. # Check device name                                               #
  1018. #-----------------------------------------------------------------#
  1019. [ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
  1020.         "$PROG: Backup device or file name must start with a '/'."
  1021. #-----------------------------------------------------------------#
  1022. # Check tape device.                                              #
  1023. #-----------------------------------------------------------------#
  1024. case "$DEVICE"
  1025. in
  1026.     #
  1027.     # Fix the block size if $DEVICE is a tape device
  1028.     #
  1029.     /dev/rmt[0-9]*)
  1030.         #
  1031.         echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
  1032.         #
  1033.         # see if a low or high density tape device was specified
  1034.         # (eg rmt0.1)
  1035.         density="`expr $DEVICE : \
  1036.                 "/dev/rmt[0-9]*\.\([0-9]*\)"`"
  1037.         #
  1038.         # strip /dev/ from device name and
  1039.         # get the base name (eg translate:
  1040.         # /dev/rmt0.2 to rmt0)
  1041.         #
  1042.         tapedev="`expr $DEVICE : \
  1043.                 "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
  1044.         #
  1045.         # Check if the tape is defined in the system.
  1046.         lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
  1047.         rc=$?
  1048.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  1049.         #
  1050.         # Restore old tape name.
  1051.         #
  1052.         [ "${density:-1}" -lt 4 ] && density=1 || density=5
  1053.         DEVICE="/dev/${tapedev}.${density}"
  1054.         echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
  1055.         read TEMP
  1056.         echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
  1057.         tctl -f $DEVICE rewind 2>/dev/null
  1058.         ;;
  1059.     #
  1060.     # Backup is done on remote host. The remote shell facility
  1061.     # must be set up and running.
  1062.     #
  1063.     ${PIPE}*)
  1064.         #
  1065.         echo "\n\t$PROG: Assuming remote backup via network.\n"
  1066.         echo "\t$PROG: Enter name of Remote Host   ===> \c"
  1067.         read REMOTEH
  1068.         echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
  1069.         ping ${REMOTEH} 1 1 >/dev/null 2>&1
  1070.         rc=$?                                    # give up unknown host
  1071.         [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
  1072.         JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
  1073.         rc=$?                                    # give up rsh failed
  1074.         [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
  1075.         echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
  1076.         echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
  1077.         read REMOTET
  1078.         echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(press enter)"
  1079.         read TEMP
  1080.         echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
  1081.         rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
  1082.         rc=$?                                    # give up rsh failed
  1083.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  1084.         rm -f ${PIPE} 2>/dev/null
  1085.         mknod ${PIPE} p
  1086.         rc=$?                                    # give up mknod failed
  1087.         [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
  1088.         cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
  1089.         ;;
  1090.     *)  ;;
  1091. esac
  1092. #-----------------------------------------------------------------#
  1093. # Prepare the list.                                               #
  1094. #-----------------------------------------------------------------#
  1095. echo "\n\t$PROG: Create list of files to be saved...."
  1096. find $HOME -print > $LIST
  1097. rc=$?
  1098. [ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
  1099. #-----------------------------------------------------------------#
  1100. # tar the files.                                                  #
  1101. #-----------------------------------------------------------------#
  1102. echo "\n\t$PROG: Changing current directory to (/)...."
  1103. cd / > /dev/null 2>&1
  1104. echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
  1105. tar -cvf "$DEVICE" -L "$LIST"
  1106. rc="$?"
  1107. [ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
  1108. #-----------------------------------------------------------------#
  1109. # Backup completed                                                #
  1110. #-----------------------------------------------------------------#
  1111. TODAY=$(date +%H:%M:%S)
  1112. echo "\n\t$PROG ended at $TODAY............................\n\n"
  1113. cleanup 0
  1114. #-----------------------------------------------------------------#
  1115. # EOF                                                             #
  1116. #-----------------------------------------------------------------#
  1117.  
  1118.  
  1119. 1.22: How do I backup a multi-disk volume group?
  1120. From: pack@acd.ucar.edu (Daniel Packman)
  1121.  
  1122. [ Editor's note: I have not verified this procedure.  I would actually
  1123.   recommend NOT to have one volume group span multiple disks unless you
  1124.   really need such big logical volumes. ]
  1125.  
  1126.   1. If you have a set of three or more disks in a volume group.
  1127.      (typically 3 for 5xx machines with three internal drives;
  1128.      with only two, the procedures outlined here have to be modified
  1129.      to ignore the fact that you don't have a quorum in the volume group)
  1130.  
  1131.   2. If one drive has failed (usually only one fails at a time :-) )
  1132.  
  1133. It is possible to go through a service boot and (if we say the volume
  1134. group is called rootvg and one of the 2 good disks on it is called hdisk0):
  1135.  
  1136.   importvg -y rootvg hdisk0
  1137.   varyonvg -f -n -m1 rootvg
  1138.  
  1139. These commands will work, but give error messages.  If you wish to mount
  1140. a user filesystem, say /u on logical volume /dev/lv00, then
  1141.  
  1142.   mount -f /dev/lv00 /v
  1143.  
  1144. will work only if the jfslog, the journaled file system log device, is not
  1145. on the damaged disk.  If it is, you must (and can in any case) mount the
  1146. filesystem read-only:
  1147.  
  1148.   mount -f -r /dev/lv00 /v
  1149.  
  1150. This crucial and rather obvious point baffled several level 3 support
  1151. personnel at Austin as well as myself for almost a week.  Once the file
  1152. system(s) of interest are available, then they can be saved to tape for
  1153. restoration later.  Of course, one can expect only about two thirds of a
  1154. filesystem to be recoverable if it spans all 3 physical disks.  One
  1155. other point to remember is that the standard boot procedure from floppy
  1156. includes the restore command but does not include the backup command. 
  1157.  
  1158. ******************************************************************************
  1159. * If you do not have other RS6000 machines at your site is is imperative     * 
  1160. * that you either build a bootable tape which includes either restore or     * 
  1161. * tar or cpio (a bootable floppy set will not have enough space) or at the   *
  1162. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy      *
  1163. * should be created with backup -ivq so that its contents can be read into   *
  1164. * the memory resident system after booting.                                  *
  1165. ******************************************************************************
  1166.  
  1167. All is not lost if tar, cpio or backup are available on an undamaged
  1168. disk that can be mounted.  Since tar and cpio are in /bin, they may both
  1169. very well be unavailable.
  1170.  
  1171. It is a very good idea for those who have tape devices to build a
  1172. bootable tape with their desired extra commands in it.  Follow the
  1173. instructions from IBM but add your desired commands to the following
  1174. three files:
  1175.  
  1176.     /usr/lpp/bosinst/tape2
  1177.     /usr/lpp/bosinst/diskette/boot2
  1178.     /usr/lpp/bosinst/diskette/inslist
  1179.  
  1180. If you have anything other than a minimum memory configuration, you
  1181. should be able to add many commands.
  1182.  
  1183.  
  1184. 1.23: How do I put multiple backups on a single 8mm tape?
  1185. From: kerm@mcnc.org (Cary E. Burnette)
  1186.  
  1187. There are two possible solutions to this, which both use the /dev/rmt0.1
  1188. device which is non-rewinding.
  1189.  
  1190. SOLUTION #1
  1191. -----------
  1192.  
  1193. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  1194. no-rewind device, using either rdump or backup (both by name & inode
  1195. work).  Using rdump or backup "byinode" both generate the message that
  1196. the tape is rewinding but actually do not.  This is an example that
  1197. would work on my system:
  1198.  
  1199. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  1200. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  1201. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  1202.  
  1203. where I am implementing the command from host.
  1204. To restore a table of contents of the first I would use 
  1205.  
  1206. # restore -f /dev/rmt0.1 -s1 -tv
  1207.  
  1208. where the -s1 flag tells restore to go to the first record it comes
  1209. across on the tape.  To get the second type in exactly the same once
  1210. again.  Basically -s(Number) stands for - go to Number record from this
  1211. spot.  It works pretty well.
  1212.  
  1213.  
  1214. SOLUTION #2
  1215. -----------
  1216.  
  1217. Steve Knodle
  1218. Educational Resources Center
  1219. Clarkson University
  1220.  
  1221. I use:
  1222. ------------------- Dump.sh --------------------
  1223. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  1224. set -x
  1225. LEVEL=$1
  1226. shift
  1227.  
  1228. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  1229. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  1230. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  1231. tctl -f /dev/rmt0 rewind
  1232.  
  1233. touch /usr/local/dumps/Contents.$CONTENTSFILE
  1234. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1235. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1236. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1237. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1238. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1239. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1240. tctl -f /dev/rmt0 rewind
  1241.  
  1242. I process the table-of-contents first by a little program that does
  1243. common prefix encoding, and then compress.
  1244.  
  1245. This gives a table of contents file I can keep on-line until the tape
  1246. is reused.
  1247.  
  1248.  
  1249. 1.24 *How do I remove a committed lpp?
  1250. From: drb@chmeds.ac.nz (Ross Boswell)
  1251.  
  1252. This seems to be a common problem.  I got the following script from IBM
  1253. NZ AIX software support.  As far as I know, it works -- I used it to
  1254. remove unwanted fonts.  I have no official permission to post it -- use
  1255. it at your own risk!
  1256.  
  1257. #!/bin/ksh
  1258. #
  1259. # Permanently remove a product from disk and AIX databases
  1260. #
  1261.  
  1262. if [ `whoami` != "root" ] ; then
  1263.   echo You must be root to run this script.
  1264.   exit 1
  1265. fi
  1266.  
  1267. if [ `uname -a | awk '{print $1$4$3}'` != "AIX32" ] ; then
  1268.   echo This script only works on AIX 3.2.
  1269.   exit 1
  1270. fi
  1271.  
  1272. TMP_FREE=`df /tmp | awk '$3 ~ /[0-9]/{print $3}'`
  1273. if [ "$TMP_FREE" -lt 1000 ] ; then
  1274.    echo There is not enough room in your /tmp directory.
  1275.    echo You need 1000 KB free, and you have only $TMP_FREE KB free.
  1276.    echo Either remove some stuff from /tmp, or use chfs to make it bigger.
  1277.    exit 1
  1278. fi
  1279.  
  1280. ODMDIRS="/etc/objrepos /usr/lib/objrepos /usr/share/lib/objrepos"
  1281. ODMDIR=/usr/lib/objrepos
  1282. export ODMDIR
  1283.  
  1284. if [ $# -lt 1 ]
  1285. then
  1286.   echo usage: $0 lppname [lppname ...]
  1287.   echo lppname is a string compatible with grep, ie "X11" or "PHIGS"
  1288.   echo typing   $0 PHIGS   will remove all LPPs with PHIGS in their name.
  1289.   exit 1
  1290. fi
  1291.  
  1292. NAMES=$1
  1293. shift
  1294. while [ $# -gt 0 ] ; do
  1295.   NAMES="$NAMES|$1"
  1296.   shift
  1297. done
  1298. echo "Searching for lpps with egrep \"$NAMES\"...\c"
  1299.  
  1300. for ODMDIR in $ODMDIRS ; do
  1301.   if [ ! -d $ODMDIR -o ! -w $ODMDIR ] ; then
  1302.      echo $ODMDIR is not writeable or is not a directory.
  1303.      echo I hope this is because you are a /usr client or diskless.
  1304.      echo If you are not a diskless or a /usr client, you should stop.
  1305.      echo "Enter y to continue ->\c"
  1306.      read answer
  1307.      if [ "$answer" != "y" ] ; then
  1308.        exit 0
  1309.      fi 
  1310.   fi
  1311.   TMP=`odmget lpp | awk -F\" '/name/ {print $2}' | egrep "$NAMES"`
  1312.   LPPS=`echo $LPPS $TMP`
  1313. done
  1314.  
  1315. if [ "$LPPS" = "" ]
  1316. then
  1317.   echo "failed.\nNo LPP with the name $NAMES detected."
  1318.   exit 1
  1319. fi
  1320. echo ok.
  1321.  
  1322. for ODMDIR in $ODMDIRS ; do
  1323.   mkdir -p /tmp/rmlpp/$ODMDIR > /dev/null 2>&1
  1324. done
  1325.  
  1326. > /tmp/listOfFilesToRM$$    # truncate temporary file, just in case.
  1327. echo
  1328. echo This script is about to attempt to remove an LPP from your system.
  1329. echo I say attempt, because it could fail.  If it fails, you may have
  1330. echo to at least reload the LPP.  Use the \"lppchk\" command to make sure
  1331. echo all is well with your system.
  1332. echo
  1333. # Loop through all the LPP names found.
  1334. for LPP in $LPPS
  1335. do
  1336.   DESCR=none
  1337.   answer=""
  1338.  
  1339.   # find the LPP ids.  They will be different in the three SWVPD databases.
  1340.   for ODMDIR in $ODMDIRS ; do
  1341.     # get the lpp id for this ODMDIR (yes, they are different)
  1342.     LPPID=`odmget -q name=$LPP lpp | grep lpp_id | sed 's/.* = //'`
  1343.  
  1344.     # did we find the LPP?
  1345.     if [ "$DESCR" = "none" -a "$LPPID" != ""  ] ; then
  1346.       # all the descriptions should be the same
  1347.       DESCR=`odmget -q name=$LPP lpp | grep description | sed 's/.* = //'`
  1348.       echo "Delete $LPP, $DESCR?"
  1349.       echo "y or (n) ->\c"
  1350.       read answer
  1351.       if [ "$answer" != "y" ] ; then # jump back up to the next LPP name
  1352.         continue 2
  1353.       fi
  1354.     fi
  1355.     # if there is no DESCR, then we didn't find the LPP.  Weird.
  1356.     if [ "$DESCR" = "none" -o "$LPPID" = "" ] ; then
  1357.       continue
  1358.     fi
  1359.     SOMETHING_DONE_FLAG=true
  1360.     # Optionally, save the ODM stuff we are about to remove,
  1361.     # in case something goes wrong.  The problem is it is difficult
  1362.     # to determine if something really did fail, since these commands
  1363.     # don't return any decent error return codes.
  1364.     odmget -q lpp_id=$LPPID history   > /tmp/rmlpp/$ODMDIR/$LPP.history
  1365.     odmget -q name=$LPP lpp           > /tmp/rmlpp/$ODMDIR/$LPP.lpp
  1366.     odmget -q lpp_name=$LPP product   > /tmp/rmlpp/$ODMDIR/$LPP.product
  1367.     # Get the list of files and links to remove later....
  1368.     odmget -q lpp_id=$LPPID inventory > /tmp/rmlpp/$ODMDIR/$LPP.inventory
  1369.     awk -F\" '/loc/ {print $2}' /tmp/rmlpp/$ODMDIR/$LPP.inventory | \
  1370.       sed 's/,/ /g' >> /tmp/listOfFilesToRM$$
  1371.     odmdelete -o history -q lpp_id=$LPPID   > /dev/null 2>&1
  1372.     odmdelete -o lpp -q name=$LPP           > /dev/null 2>&1
  1373.     odmdelete -o product -q lpp_name=$LPP   > /dev/null 2>&1
  1374.     odmdelete -o inventory -q lpp_id=$LPPID > /dev/null 2>&1
  1375.   done
  1376. done
  1377.  
  1378. if [ "$SOMETHING_DONE_FLAG" = "true" ] ; then
  1379.  
  1380.   echo ODM work is done.  Now, time to delete files....
  1381.  
  1382.   # This could be catastrophic if there is a problem.  For example,
  1383.   # if the ODM database for an application had / as one of its files.
  1384.   # You be the judge.  Here's your rope....
  1385.   cat /tmp/listOfFilesToRM$$ | sort -r | uniq | xargs rm -rf
  1386.  
  1387.   rm -rf /tmp/listOfFilesToRM$$
  1388.   echo done.
  1389. fi
  1390.  
  1391. # take this line out if you want to save your ODM saved files.
  1392. rm -rf /tmp/rmlpp
  1393.  
  1394. exit 0
  1395.  
  1396.  
  1397. 1.25 *My named dies frequently, why?
  1398.  
  1399. Running on 3.2, named dies frequently on network's primary name server.
  1400.  
  1401. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  1402.  
  1403. Try the following:
  1404.  
  1405.      stopsrc -s named    # stop running named
  1406.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  1407.      /etc/named ...        # don't use smit to start named
  1408.  
  1409. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  1410. the same effect, but I'm not sure.
  1411.  
  1412. [According to John, the problem is malloc() in the named code. He
  1413.  also suggests using Berkeley's bind, which he has ported and can be
  1414.  ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
  1415.  
  1416.  
  1417. 1.26: How do I trace ethernet packets on an AIX system?
  1418. From: afx@muc.ibm.de (Andreas Siegert)
  1419.  
  1420. Do the following:
  1421.  
  1422.      iptrace -i en0 /tmp/ipt
  1423.  
  1424. The iptrace backgrounds.  Find its process id and kill it when you are
  1425. ready.  Then run
  1426.  
  1427.      ipreport -rns /tmp/ipt >/tmp/ipr
  1428.  
  1429. and look at the output.  The current version of Info does not document
  1430. the r, n and s options but they are quite useful for layering the output.
  1431.  
  1432. ______________________________________________________________________________
  1433. 2.00: C/C++
  1434.  
  1435. Contrary to many people's belief, the C environment on the RS/6000 is
  1436. not very special.  The C compiler has quite a number of options that can
  1437. be used to control how it works, which "dialect" of C it compiles, how
  1438. it interprets certain language constructs, etc.  InfoExplorer includes a
  1439. Users' Guide and a Reference Manual.
  1440.  
  1441. The compiler can be invoked with either xlc to invoke it in ANSI mode
  1442. and cc to invoke it in RT (i.e. IBM 6150 with AIX 2) compatible mode. 
  1443. The default options for each mode are set in the /etc/xlc.cfg file, and
  1444. you can actually add another stanza and create a link to the /bin/xlc
  1445. executable.
  1446.  
  1447. The file /usr/lpp/xlc/bin/README.xlc has information about the C
  1448. compiler, and the file /usr/lpp/bos/bsdport contains useful information,
  1449. in particular for users used to BSD.
  1450.  
  1451. The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
  1452. and therefore can be used for #ifdef'ing RS/6000 specific code.
  1453.  
  1454.  
  1455. 2.01: I cannot make alloca work
  1456.  
  1457. A famous routine, in particular in GNU context, is the allocation
  1458. routine alloca().  Alloca allocates memory in such a way that it is
  1459. automatically free'd when the block is exited.  Most implementations
  1460. does this by adjusting the stack pointer.  Since not all C environments
  1461. can support it, its use is discouraged, but it is included in the xlc
  1462. compiler.  In order to make the compiler aware that you intend to use
  1463. alloca, you must put the line
  1464.  
  1465. #pragma alloca
  1466.  
  1467. before any other statements in the C source module(s) where alloca is
  1468. called.  If you don't do this, xlc will not recognize alloca as anything
  1469. special, and you will get errors during linking.
  1470.  
  1471. In earlier releases of the C compiler, alloca did not work well with the
  1472. optimizer turned on (-O flag), but this problem is solved now.  The fix
  1473. was probably in release 1.1.3 of xlc.obj, it is for sure in 1.1.5.
  1474.  
  1475.  
  1476. 2.02: How do I compile my BSD programs?
  1477.  
  1478. The file /usr/lpp/bos/bsdport contains information on how to port
  1479. programs written for BSD to AIX 3.1.  The contents of this file can
  1480. actually be very useful for others as well.
  1481.  
  1482. A quick cc command for most "standard" BSD programs is:
  1483.   
  1484.   $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd
  1485.  
  1486. If your software has system calls predefined with no prototype
  1487. parameters, also use the -D_NO_PROTO flag.
  1488.  
  1489.  
  1490. 2.03: Isn't the linker different from what I am used to?
  1491.  
  1492. Yes.  It is not at all like what you are used to:
  1493.  
  1494. - The order of objects and libraries is normally _not_ important.  The
  1495.   linker reads _all_ objects including those from libraries into memory
  1496.   and does the actual linking in one go.  Even if you need to put a
  1497.   library of your own twice on the ld command line on other systems, it
  1498.   is not needed on the RS/6000 - doing so will even make your linking slower.
  1499.  
  1500. - One of the features of the linker is that it will replace an object in
  1501.   an executable with a new version of the same object:
  1502.  
  1503.   $ cc -o prog prog1.o prog2.o prog3.o        # make prog
  1504.   $ cc -c prog2.c                # recompile prog2.c
  1505.   $ cc -o prog.new prog2.o prog            # make prog.new from prog
  1506.                         # by replacing prog2.o
  1507.   
  1508. - The standard C library /lib/libc.a is linked shared, which means that
  1509.   the actual code is not linked into your program, but is loaded only
  1510.   once and linked dynamically during loading of your program.
  1511.  
  1512. - The ld program actually calls the binder in /usr/lib/bind, and you can
  1513.   give ld special options to get details about the invocation of the
  1514.   binder.  These are found on the ld man page or in InfoExplorer.
  1515.  
  1516. - If your program normally links using a number of libraries (.a files),
  1517.   you can 'prelink' each of these into an object, which will make your
  1518.   final linking faster.  E.g. do:
  1519.  
  1520.   $ cc -c prog1.c prog2.c prog3.c
  1521.   $ ar cv libprog.a prog1.o prog2.o prog3.o
  1522.   $ ld -r -o libprog.o libprog.a
  1523.   $ cc -o someprog someprog.c libprog.o
  1524.  
  1525. This will solve all internal references between prog1.o, prog2.o and
  1526. prog3.o and save this in libprog.o Then using libprog.o to link your
  1527. program instead of libprog.a will increase linking speed, and even if
  1528. someprog.c only uses, say prog1.o and prog2.o, only those two modules
  1529. will be in your final program.  This is also due to the fact that the
  1530. binder can handle single objects inside one object module as noted above.
  1531.  
  1532. If you are using an -lprog option (for libprog.a) above, and still want
  1533. to be able to do so, you should name the prelinked object with a
  1534. standard library name, e.g. libprogP.a (P identifying a prelinked
  1535. object), that can be specified by -lprogP.  You cannot use the archiver
  1536. (ar) on such an object.
  1537.  
  1538. You should also have a look at section 3.01 of this article, in
  1539. particular if you have mixed Fortran/C programs.
  1540.  
  1541.  
  1542. 2.04: How do I link my program with a non-shared /lib/libc.a?
  1543.  
  1544.   cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o
  1545.  
  1546. will do that for a program consisting of the three objects obj1.o, etc.
  1547.  
  1548.  
  1549. 2.05: How do I make my own shared library?
  1550.  
  1551. To make your own shared object or library of shared objects, you should
  1552. know that a shared object cannot have undefined symbols.  Thus, if your
  1553. code uses any externals from /lib/libc.a, the latter MUST be linked with
  1554. your code to make a shared object.  Likewise, you cannot split your code
  1555. into more than one shared object if externals in one object refer to
  1556. another one. 
  1557.  
  1558. Assume you have one file, sub1.c, containing a routine with no external
  1559. references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
  1560. will also need two export files, sub1.exp, sub2.exp.  Read the example
  1561. below together with the examples on the ld man page. 
  1562.  
  1563. ---- sub1.c ----------------------------------------------------------
  1564.     int addint(int a, int b)
  1565.     {
  1566.       return a + b;
  1567.     }
  1568. ---- sub2.c ----------------------------------------------------------
  1569.     #include <stdio.h>
  1570.  
  1571.     void printint(int a)
  1572.     {
  1573.       printf("The integer is: %d\n", a);
  1574.     }
  1575. ---- sub1.exp ----------------------------------------------------------
  1576.     #!
  1577.     addint
  1578. ---- sub2.exp ----------------------------------------------------------
  1579.     #!
  1580.     printint
  1581. ---- usesub.c ----------------------------------------------------------
  1582.     main()
  1583.     {
  1584.       printint( addint(5,8) );
  1585.     }
  1586. ---------------------------------------------------------------
  1587.  
  1588. The following commands will build your libshr.a, and compile/link the
  1589. program usesub to use it.  Note that you need the ld option -lc for
  1590. sub2shr.o since it calls printf from /lib/libc.a.
  1591.  
  1592.   $ cc  -c sub1.c
  1593.   $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  1594.   $ cc  -c sub2.c
  1595.   $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  1596.   $ ar r libshr.a sub1shr.o sub2shr.o
  1597.   $ cc -o usesub usesub.c -L: libshr.a
  1598.   $ usesub
  1599.   The integer is: 13
  1600.   $
  1601.  
  1602.  
  1603. 2.06: Linking my program fails with strange errors.  Why?
  1604.  
  1605. Very simple, the linker (actually called the binder), cannot get the
  1606. memory it needs, either because your ulimits are too low or because you
  1607. don't have sufficient paging space.  Since the linker is quite different
  1608. from normal Unix linkers and actually does much more than these, it also
  1609. uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
  1610. 4k) or more to execute a fairly complex linking.
  1611.  
  1612. If you get 'BUMP error', either ulimits or paging is too low, if you get
  1613. 'Binder killed by signal 9' your paging is too low.
  1614.  
  1615. First, check your memory and data ulimits; in korn shell 'ulimit -a' will
  1616. show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
  1617. increase the maximum memory and data respectively to some high values. 
  1618. If this was not your problem, you don't have enough paging space.
  1619.  
  1620. If you will or can not increase your paging space, you could try this:
  1621.  
  1622. - Do you duplicate libraries on the ld command line? That is never
  1623.   necessary.
  1624.  
  1625. - Do more users link simultaneously? Try having only one linking going
  1626.   on at any time.
  1627.  
  1628. - Do a partwise linking, i.e.  you link some objects/libraries with the
  1629.   -r option to allow the temporary output to have unresolved references,
  1630.   then link with the rest of your objects/libraries.  This can be split
  1631.   up as much as you want, and will make each step use less virtual memory.
  1632.  
  1633.   If you follow this scheme, only adding one object or archive at a
  1634.   time, you will actually emulate the behavior of other Unix linkers.
  1635.  
  1636. If you decide to add more paging space, you should consider adding a new
  1637. paging space on a second hard disk, as opposed to just increasing the
  1638. existing one.  Doing the latter could make you run out of free space on
  1639. your first harddisk. It is more involved to shrink a paging space
  1640. but easier to delete one.
  1641.  
  1642. -- 
  1643. Luis Basto
  1644. Computer Sciences Corporation
  1645. Internet: basto@cactus.org
  1646. Usenet:   cs.utexas.edu!mavrick!luis
  1647.